package com.shuimutong.gmvc_ioc_demo.service.impl;

import com.shuimutong.gmvc.annotation.XAutowired;
import com.shuimutong.gmvc.annotation.XService;
import com.shuimutong.gmvc_ioc_demo.bean.Person;
import com.shuimutong.gmvc_ioc_demo.dao.TestDao;
import com.shuimutong.gmvc_ioc_demo.service.TestService;

@XService
public class TestServiceImpl implements TestService {
	@XAutowired
	private TestDao testDao;
	
	@Override
	public void speak() {
		System.out.println("----TestServiceImpl-----speak--");
	}

	@Override
	public String convertString(String s) {
		Person p = testDao.findPerson();
		String perString = "addStr:" + s 
				+ String.format(",Person(name:%s,age:%d)", p.getName(), p.getAge());
		return perString;
	}

}
